from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler

import config
from app import app, logger
from app import view

if __name__ == '__main__':
    logger.info("server running...")
    host_port = (config.host, config.port)
    logger.info(host_port)
    server = pywsgi.WSGIServer(host_port, app, handler_class=WebSocketHandler)
    server.serve_forever()
